#
# Copyright (c) 2010 Josef Hardi. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

NewcomersVersusLongTerm <- function(avg.newcomers, avg.longterms, alternative) {

  dataset.newcomers <- c(avg.newcomers$S7[avg.newcomers$S7!=-1.0000], 
  						 avg.newcomers$S8[avg.newcomers$S8!=-1.0000],
  						 avg.newcomers$S9[avg.newcomers$S9!=-1.0000],
  						 avg.newcomers$S10[avg.newcomers$S10!=-1.0000])
  						 
  dataset.longterms <- c(avg.longterms$S7[avg.longterms$S7!=-1.0000], 
  						 avg.longterms$S8[avg.longterms$S8!=-1.0000],
  						 avg.longterms$S9[avg.longterms$S9!=-1.0000],
  						 avg.longterms$S10[avg.longterms$S10!=-1.0000])
  
  print("NEWCOMERS:")
  print(summary(dataset.newcomers))
  print(sd(dataset.newcomers))
  
  print("LONGTERMS:")
  print(summary(dataset.longterms))
  print(sd(dataset.longterms))
  
  ks.test(dataset.newcomers, dataset.longterms, alternative=alternative)
}